//
// Created by wkm on 2024-04-25.
//

#include "aes128_test.h"

void aes128_test() {
    sc_clock clk("my_clk", 2, sc_core::SC_NS);
    sc_signal<bool> test_reset;
    sc_signal<bool> test_start;
    sc_signal<exe_state> test_done;
    sc_signal<sc_uint<DATA_SIZE>> key1, key2, key3, key4, key5, key6, key7, key8,
            key9, key10, key11, key12, key13, key14, key15, key16;
    sc_signal<sc_uint<DATA_SIZE>> pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8,
            pt9, pt10, pt11, pt12, pt13, pt14, pt15, pt16;
    sc_signal<sc_uint<DATA_SIZE>> ct1, ct2, ct3, ct4, ct5, ct6, ct7, ct8,
            ct9, ct10, ct11, ct12, ct13, ct14, ct15, ct16;

    aes128en my_aes128("my_aes128");
    my_aes128.clk(clk);
    my_aes128.start(test_start);
    my_aes128.reset(test_reset);
    my_aes128.key1(key1);
    my_aes128.key2(key2);
    my_aes128.key3(key3);
    my_aes128.key4(key4);
    my_aes128.key5(key5);
    my_aes128.key6(key6);
    my_aes128.key7(key7);
    my_aes128.key8(key8);
    my_aes128.key9(key9);
    my_aes128.key10(key10);
    my_aes128.key11(key11);
    my_aes128.key12(key12);
    my_aes128.key13(key13);
    my_aes128.key14(key14);
    my_aes128.key15(key15);
    my_aes128.key16(key16);
    my_aes128.pt1(pt1);
    my_aes128.pt2(pt2);
    my_aes128.pt3(pt3);
    my_aes128.pt4(pt4);
    my_aes128.pt5(pt5);
    my_aes128.pt6(pt6);
    my_aes128.pt7(pt7);
    my_aes128.pt8(pt8);
    my_aes128.pt9(pt9);
    my_aes128.pt10(pt10);
    my_aes128.pt11(pt11);
    my_aes128.pt12(pt12);
    my_aes128.pt13(pt13);
    my_aes128.pt14(pt14);
    my_aes128.pt15(pt15);
    my_aes128.pt16(pt16);
    my_aes128.done(test_done);
    my_aes128.ct1(ct1);
    my_aes128.ct2(ct2);
    my_aes128.ct3(ct3);
    my_aes128.ct4(ct4);
    my_aes128.ct5(ct5);
    my_aes128.ct6(ct6);
    my_aes128.ct7(ct7);
    my_aes128.ct8(ct8);
    my_aes128.ct9(ct9);
    my_aes128.ct10(ct10);
    my_aes128.ct11(ct11);
    my_aes128.ct12(ct12);
    my_aes128.ct13(ct13);
    my_aes128.ct14(ct14);
    my_aes128.ct15(ct15);
    my_aes128.ct16(ct16);

    aes128_driver my_aes128_driver("my_aes128_driver");
    my_aes128_driver.d_clk(clk);
    my_aes128_driver.d_reset(test_reset);
    my_aes128_driver.d_start(test_start);
    my_aes128_driver.d_key1(key1);
    my_aes128_driver.d_key2(key2);
    my_aes128_driver.d_key3(key3);
    my_aes128_driver.d_key4(key4);
    my_aes128_driver.d_key5(key5);
    my_aes128_driver.d_key6(key6);
    my_aes128_driver.d_key7(key7);
    my_aes128_driver.d_key8(key8);
    my_aes128_driver.d_key9(key9);
    my_aes128_driver.d_key10(key10);
    my_aes128_driver.d_key11(key11);
    my_aes128_driver.d_key12(key12);
    my_aes128_driver.d_key13(key13);
    my_aes128_driver.d_key14(key14);
    my_aes128_driver.d_key15(key15);
    my_aes128_driver.d_key16(key16);
    my_aes128_driver.d_pt1(pt1);
    my_aes128_driver.d_pt2(pt2);
    my_aes128_driver.d_pt3(pt3);
    my_aes128_driver.d_pt4(pt4);
    my_aes128_driver.d_pt5(pt5);
    my_aes128_driver.d_pt6(pt6);
    my_aes128_driver.d_pt7(pt7);
    my_aes128_driver.d_pt8(pt8);
    my_aes128_driver.d_pt9(pt9);
    my_aes128_driver.d_pt10(pt10);
    my_aes128_driver.d_pt11(pt11);
    my_aes128_driver.d_pt12(pt12);
    my_aes128_driver.d_pt13(pt13);
    my_aes128_driver.d_pt14(pt14);
    my_aes128_driver.d_pt15(pt15);
    my_aes128_driver.d_pt16(pt16);

    aes128_monitor my_aes128_monitor("my_aes128_monitor");
    my_aes128_monitor.m_done(test_done);
    my_aes128_monitor.m_ct1(ct1);
    my_aes128_monitor.m_ct2(ct2);
    my_aes128_monitor.m_ct3(ct3);
    my_aes128_monitor.m_ct4(ct4);
    my_aes128_monitor.m_ct5(ct5);
    my_aes128_monitor.m_ct6(ct6);
    my_aes128_monitor.m_ct7(ct7);
    my_aes128_monitor.m_ct8(ct8);
    my_aes128_monitor.m_ct9(ct9);
    my_aes128_monitor.m_ct10(ct10);
    my_aes128_monitor.m_ct11(ct11);
    my_aes128_monitor.m_ct12(ct12);
    my_aes128_monitor.m_ct13(ct13);
    my_aes128_monitor.m_ct14(ct14);
    my_aes128_monitor.m_ct15(ct15);
    my_aes128_monitor.m_ct16(ct16);

    sc_start();
}